Signed-off-by: Ian Campbell <Ian.Campbell@XenSource.com>
}
if (HYPERVISOR_set_gdt(frames, gdt_descr->size / 8))
BUG();
- lgdt_finish();
+
+ /* Reload all the segment registers after changing gdt. */
+ asm volatile("movl %0,%%ss\n\t"
+ "movl %1,%%ds\n\t"
+ "movl %1,%%es\n\t"
+ "pushl %2\n\t" /* Reload CS by intersegment return. */
+ "pushl $1f\n\t"
+ "lret\n\t"
+ "1:\n\t"
+ : /* no outputs */
+ : "r"(__KERNEL_DS),
+ "r"(__USER_DS),
+ "r"(__KERNEL_CS));
}
/*
jmp L6 # main should never return here, but
# just in case, we know what happens.
-ENTRY(lgdt_finish)
- movl $(__KERNEL_DS),%eax # reload all the segment registers
- movw %ax,%ss # after changing gdt.
-
- movl $(__USER_DS),%eax # DS/ES contains default USER segment
- movw %ax,%ds
- movw %ax,%es
-
- popl %eax # reload CS by intersegment return
- pushl $(__KERNEL_CS)
- pushl %eax
- lret
-
ALIGN
# boot GDT descriptor (later on used by CPU#0):
/* arch/xen/i386/kernel/hypervisor.c */
void do_hypervisor_callback(struct pt_regs *regs);
-/* arch/xen/i386/kernel/head.S */
-void lgdt_finish(void);
-
/* arch/xen/i386/mm/hypervisor.c */
/*
* NB. ptr values should be PHYSICAL, not MACHINE. 'vals' should be already